<%@ page import="weaver.general.Util" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.List" %>
<%@ page import="org.apache.commons.lang.StringUtils" %>
<%@ page language="java" contentType="text/html; charset=utf-8" %>
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page"/>
<jsp:useBean id="rs1" class="weaver.conn.RecordSet" scope="page"/>
<jsp:useBean id="rs2" class="weaver.conn.RecordSet" scope="page"/>
<jsp:useBean id="bb" class="weaver.general.BaseBean"/>
<%
    String json = "{\"flag\":\"0\"}";
    int requestid = Util.getIntValue(request.getParameter("requestid"));
    rs.executeQuery("select id from formtable_main_198 where requestid='" + requestid + "'");
    bb.writeLog("select id from formtable_main_198 where requestid='" + requestid + "'");
    rs.next();
    String mainid = Util.null2String(rs.getString("id"));
    rs2.executeQuery("select id,tpdxwb from formtable_main_198_dt1 where mainid='" + mainid + "' and tpdxwb !=''");
    while (rs2.next()){
        String id = Util.null2String(rs2.getString("id"));
        String tpdxwb = Util.null2String(rs2.getString("tpdxwb"));
        rs2.executeUpdate("update formtable_main_198_dt1 set tp = '"+tpdxwb+"' where id='"+id+"'");
        bb.writeLog("update formtable_main_198_dt1 set tp = '"+tpdxwb+"' where id='"+id+"'");
    }
    rs1.executeQuery("select sfth  from formtable_main_198_dt1 where mainid='" + mainid + "' and sfth !=''");
    List<String> list = new ArrayList<>();
    while (rs1.next()) {
        String sfth = Util.null2String(rs1.getString("sfth"));
        list.add(sfth);
    }
    String str = StringUtils.strip(list.toString().replaceAll(" ",""), "[]");
    if (!"".equals(str)) {
        json ="{\"flag\":\"1\",\"str\":\"" + str + "\"}";
    }
    bb.writeLog(json);
    out.print(json);
%>